package main.java.tmi.user.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import main.java.tmi.common.service.UserVO;
import main.java.tmi.common.service.impl.AbstractDao;

import org.springframework.stereotype.Repository;

/**
 * UserManage Data Access Object (cust Table)
 *
 * @author min™
 * @since 2012. 04. 24
 */
@Repository
public class UserManageDAO extends AbstractDao {
	
	/**
	 * UserManage search
	 * @return List<UserManageVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<UserVO> getUserManageView(Map<String,String> param) throws SQLException {
				
		return (List<UserVO>) list("UserManageDAO.getUserManageView", param);
	}
	
	/**
	 * UserManage search
	 * @return List<UserManageVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public int getUserManageViewCount(Map<String,String> param) throws SQLException {
		return Integer.parseInt((String) getSqlMapClientTemplate().queryForObject("UserManageDAO.getUserManageViewCount", param));
	}
	
	/**
	 * UserManage search
	 * @return List<UserManageVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public Map<String,String>  getUserManageDetailView(Map<String,String> param) throws SQLException {
		Map<String,String> returnMap ;
        returnMap = (Map<String,String>) selectByPk("UserManageDAO.getUserManageDetailView", param);
        
        return returnMap;
	}
	
	/**
	 * UserManage save
	 * @return void
	 * @throws SQLException 
	 */
	public void addUserManage(Map<String,String> param) throws SQLException {
		insert("UserManageDAO.addUserManage", param);
	}
	
	/**
	 * UserManage modify
	 * @return void
	 * @throws SQLException 
	 */
	public void modifyUserManage(Map<String,String> param) throws SQLException {
		insert("UserManageDAO.modifyUserManage", param);
	}
	
	/**
	 * UserManage del
	 * @return void
	 * @throws SQLException 
	 */
	public void delUserManage(Map<String,String> param) throws SQLException {
		insert("UserManageDAO.delUserManage", param);
	}	
	
	/**
	 * UserManage modify
	 * @return void
	 * @throws SQLException 
	 */
	public void updateMyInfo(Map<String,String> param) throws SQLException {
		insert("UserManageDAO.updateMyInfo", param);
	}
	
	/**
	 * UserManage CheckId
	 * @return List<UserManageVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public int getCheckId(Map<String,String> param) throws SQLException {
		return Integer.parseInt((String) getSqlMapClientTemplate().queryForObject("UserManageDAO.getCheckId", param));
	}
}
